{% extends 'layout.html' %}
{% block title %}
    <title>个人信息</title>
{% endblock %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">个人信息</div>
        <div class="panel-body">
            <form action="{% url 'user_personal' %}" method="post">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" class="form-control" name="username" value="{{ user.username }}" readonly
                           id="username"
                           placeholder="请输入名称">
                </div>
                <div class="form-group">
                    <label for="age">年龄</label>
                    <input type="number" class="form-control" name="age" id="age" value="{{ user.age }}"
                           placeholder="请输入年龄">
                </div>


                <div class="form-group">
                    <label for="gender">性别</label>
                    <select class="form-control" name="gender">
                        <option value="1" {% if user.gender == 1 %}selected{% endif %}>男</option>
                        <option value="2" {% if user.gender == 2 %}selected{% endif %}>女</option>
                    </select>
                </div>
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
            <span style="color: red">{{ error }}</span>
        </div>
    </div>

{% endblock %}